package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119676168";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDLKhWm5CCmPf2QDFvFpRCcLzSLIwEu5uETZkaZ/FOXfbyIuhuOEgX3WGXTjzjpqR4Te7VZQcbliJJrxrkPFYH4JQcKkXmBAgkctUWDZjC5Kb3UkRAa3ajdhoKaZV027CSLWU4dvmYk/y9a8IoJ9EdV09taSEUKrkW/RkOMG2+Uook0ZmVjCEdkZkNlY7wHgm4s+TK0w1EdwCj8MSzNFtVwVIZKi9ndmzsnZxv9AIRy62T94ovrMxIei3qYHY0rZVcM7WhbqY40otlaFW3In5aLiiu9slO6mpAoNlHvaCEc3UR8xHveUSnXXrs1TXibjuuPgoYAamg5vEC81ZvxQipHAgMBAAECggEASEH+k239wsK3hV0v4rrTjoknifj4OcM5+BlfMPNSk8XPoV134W69mnxhMv50gn54yPstw8ImSIrrcNOsDBZdNHGO8I5PBbhAn2pFf/d/isuyzYCOls+ReMCXgOxeW+NfGAS6SM/oKm5sXE7C+clc+cSw9opPq/3RprcJ3TIA3H7TR5ptrdGjC03lCkNOIa9UY4XlecK3eBkbRmPanWWNvMKfiRnE5If9cUoIhy2prBNSpFFwYRdBiqrp9q40SOsUkW5P5plus6bR4flw37duP6FOUK0/PVmJtDyx2V6wFBVgUVogyUxPHBNQUTSjQ8LO8S5zalo7+kVTPHV+sfrbeQKBgQD/L5WHsc/q5dB9f5sOVyeF7H/o9kZcnYJKcz6YZgqpFUj0O5bLQBSPk5mxf9y9z9hl02ei2PbQEli5BOqjBj0d6R+aLD3bAR8FyIUEVAV3YxSGZoAUAxj7T2Ar4HSw7BqhfGDujv1O7kdAXwjdXPfHn6IzW+Y5UFO+LbFMznKbwwKBgQDL0ANtlldxwgrm1WH2VGxehGOH7tUn9TErQYN0cIjv9RN/Nv9b7nifl4rW+bSb3I8Ev8qgpPAQE41CV78nymxr60mOj/eyDA8HUnxhfbyIDgz1J0WUZjacl6jjI5T1ZLRPhguv+mgocghaIp8ZpzDIfl/1ljtA11wrr9oQKniDLQKBgGnhHHHI3TPhVrg7keJJVyTCE/Bc/qS+1ah+WKJy9Eljg3mSn+aFGALagxKassQu0OKu7Hks/HsooZdi6tfpZsJaT7pwUNnlhTGpGUfKdNosSf/Z15p2Do93R7fs0X32+LW4HZ/dxExToUycIdl3EXfKTEpy/vsY0SY/Xyk3H2ZxAoGBAKQm9Zvd6rAEySMB2dS8SkwV9NQW2DdGlENykJ3HxYL+sKVVdnZkq2Jee8SJeZ3PFqGMl3arYW6RUMSOR7eUoZ6J8sSPz7/nVnNfTC55Rs+OAYGyD6hmarXUsIHAtsiuQ0uJewBRfnKU5YUzPVE8B15z6nWyeibPTb0h9U/v5QBBAoGAOv88zqGHXZ8dI1R5PkTWejU2Pd8DziqafHd+40AN2upJbcQNWsMvLXMEx8KxWGbG5MLL/38H4RdB+aUv279d9d53AzaXRINmPWb/jHXTUAPauSNIYOPQdpRi9E7ISh6LBALND30EcM5QX5AGjggHVeFMCCydYySFq3v8FjQs9vQ=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyyoVpuQgpj39kAxbxaUQnC80iyMBLubhE2ZGmfxTl328iLobjhIF91hl04846akeE3u1WUHG5YiSa8a5DxWB+CUHCpF5gQIJHLVFg2YwuSm91JEQGt2o3YaCmmVdNuwki1lOHb5mJP8vWvCKCfRHVdPbWkhFCq5Fv0ZDjBtvlKKJNGZlYwhHZGZDZWO8B4JuLPkytMNRHcAo/DEszRbVcFSGSovZ3Zs7J2cb/QCEcutk/eKL6zMSHot6mB2NK2VXDO1oW6mONKLZWhVtyJ+Wi4orvbJTupqQKDZR72ghHN1EfMR73lEp1167NU14m47rj4KGAGpoObxAvNWb8UIqRwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/library_war_exploded/reader/04readerFrame.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}